package mryao.tree.AVL;

import mryao.tree.treeNode;

public class AVLNode extends treeNode<Integer> {
    private treeNode parent;
    private int height;

    public AVLNode() {
        super();
        this.parent = null;
        this.height = 0;
    }

    public AVLNode(Integer data){
        super(data);
        this.parent = null;
        this.height = 0;
    }

    public AVLNode(Integer data, treeNode parent) {
        super(data);
        this.parent = parent;
        this.height = 0;
    }

    public AVLNode(Integer data, treeNode left, treeNode right, treeNode parent) {
        super(data, left, right);
        this.parent = parent;
        this.height = 0;
    }

    public treeNode getParent() {
        return parent;
    }

    public void setParent(treeNode parent) {
        this.parent = parent;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    @Override
    public AVLNode getLeft() {
        return (AVLNode) super.getLeft();
    }

    @Override
    public AVLNode getRight() {
        return (AVLNode) super.getRight();
    }
}
